package com.guldan.mapper.db.mapper;

import com.guldan.mapper.db.dto.orgBatchSummary.OrgBatchSummaryExtDTO;
import com.guldan.mapper.db.entity.OrgBatchSummary;
import com.guldan.mapper.db.entity.OrgBatchSummaryExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by Silas.
 * Date: 2016/11/20
 * Time: 11:44
 */
public interface OrgBatchSummaryMapperExt extends OrgBatchSummaryMapper {
    List<OrgBatchSummary> selectByExampleWithPaging(
            @Param("example") OrgBatchSummaryExample example, @Param("offset") int offset,
            @Param("limit") int limit);


    //主管部门汇总上报，查询汇总记录
    List<OrgBatchSummaryExtDTO> collectBatchIdForOrgSubmit(@Param("state") int state, @Param("batchIds") List<Integer> batchIds);


    //主管部门查看已上报的批次汇总记录

    List<OrgBatchSummary> orgSelectSummaryBatchList(@Param("orgCode") String orgCode,
                                                    @Param("states") List<Integer> states,
                                                    @Param("areaIds") List<Integer> areaIds,
                                                    @Param("projectId") Integer projectId,
                                                    @Param("year") Integer year,
                                                    @Param("payCycleCode") String payCycleCode,
                                                    @Param("subsidyCount") Integer subsidyCount,
                                                    @Param("offset") int offset,
                                                    @Param("limit") int limit);


    //主管部门获取待审批登记批次列表，统计
    int orgSelectSummaryBatchListCount(@Param("orgCode") String orgCode,
                                       @Param("states") List<Integer> states,
                                       @Param("areaIds") List<Integer> areaIds,
                                       @Param("projectId") Integer projectId,
                                       @Param("year") Integer year,
                                       @Param("payCycleCode") String payCycleCode,
                                       @Param("subsidyCount") Integer subsidyCount);


    //财政，获取待审批批次汇总记录
    List<OrgBatchSummary> financeSelectSummaryBatchList(@Param("orgCode") String orgCode,
                                                        @Param("states") List<Integer> states,
                                                        @Param("areaIds") List<Integer> areaIds,
                                                        @Param("projectId") Integer projectId,
                                                        @Param("year") Integer year,
                                                        @Param("payCycleCode") String payCycleCode,
                                                        @Param("subsidyCount") Integer subsidyCount,
                                                        @Param("offset") int offset,
                                                        @Param("limit") int limit);

    //财政，获取待审批批次汇总记录，统计
    int financeSelectSummaryBatchListCount(@Param("orgCode") String orgCode,
                                           @Param("states") List<Integer> states,
                                           @Param("areaIds") List<Integer> areaIds,
                                           @Param("projectId") Integer projectId,
                                           @Param("year") Integer year,
                                           @Param("payCycleCode") String payCycleCode,
                                           @Param("subsidyCount") Integer subsidyCount);

}
